/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.AlwaysOnCluster;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Iterator;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetAllAlwaysOnClusters
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public static final String BY_NAME = "name";
/*    */   public static final String BY_ID = "id";
/*    */   
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 41 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 42 */     Provisioning prov = Provisioning.getInstance();
/*    */     
/* 44 */     List<AlwaysOnCluster> clusters = prov.getAllAlwaysOnClusters();
/*    */     
/* 46 */     AdminAccessControl aac = AdminAccessControl.getAdminAccessControl(zsc);
/*    */     
/* 48 */     Element response = zsc.createElement(AdminConstants.GET_ALL_ALWAYSONCLUSTERS_RESPONSE);
/* 49 */     for (Iterator<AlwaysOnCluster> it = clusters.iterator(); it.hasNext();) {
/* 50 */       AlwaysOnCluster cluster = (AlwaysOnCluster)it.next();
/* 51 */       if (aac.hasRightsToList(cluster, Rights.Admin.R_listAlwaysOnCluster, null)) {
/* 52 */         GetAlwaysOnCluster.encodeAlwaysOnCluster(response, cluster, null, aac.getAttrRightChecker(cluster));
/*    */       }
/*    */     }
/* 55 */     return response;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 60 */     relatedRights.add(Rights.Admin.R_listAlwaysOnCluster);
/* 61 */     relatedRights.add(Rights.Admin.R_getAlwaysOnCluster);
/*    */     
/* 63 */     notes.add("If the authenticated admin does not have the corresponding list{Entry} right for an entry, the entry is skipped in the getAllXXX/searchXXX/searchDirectoryResponse,  no PERM_DENIED exception will be thrown. Attributes that are not allowed to be get by the authenticated admin will be returned as <a n=\"{attr-name}\" pd=\"1\"/>.");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetAllAlwaysOnClusters.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */